import java.util.Scanner;

public class Main1055 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = 0;
        for (int i = 1; i <= n; i++) {
            if (i % 3 == 2 && i % 5 == 3 && i % 7 == 2) {
                a++;
            }
        }if (a!=0){
            System.out.println(a);
        }else System.out.println("0");
    }
}